package com.wyl.proxy.demo02

class UserServiceProxy(private val target: UserService) : UserService by target {
    override fun add() {
        log("add")
        target.add()
    }

    override fun delete() {
        log("delete")
        target.delete()
    }

    override fun update() {
        log("update")
        target.update()
    }

    override fun query() {
        log("query")
        target.query()
    }

    private fun log(msg: String) {
        println("使用了$msg 方法")
    }
}